from django.db import models

# Create your models here.
class Computer(models.Model):
    com = models.CharField(max_length=100,verbose_name='主机')
    city = models.CharField(max_length=100,verbose_name='城市')
    room = models.CharField(max_length=100,verbose_name='机房')
    ip = models.CharField(max_length=20,verbose_name='ip')
    def __str__(self):
        return self.com

class Count_City_Com(models.Model):
    city = models.CharField(max_length=100, verbose_name='城市')
    count = models.IntegerField(verbose_name='主机数量')
    date = models.DateField(verbose_name='统计日期')

    class Meta:
        verbose_name = '城市主机统计'
        verbose_name_plural = verbose_name
        unique_together = ('city', 'date')

class Count_Room_Com(models.Model):
    room = models.CharField(max_length=100, verbose_name='机房')
    count = models.IntegerField(verbose_name='主机数量')
    date = models.DateField(verbose_name='统计日期')

    class Meta:
        verbose_name = '机房主机统计'
        verbose_name_plural = verbose_name
        unique_together = ('room', 'date')
